/*
 * 作者:熊猫
 * 日期:2017 - 3 - 14 8 - 7 - 26
 *
 */

package net.lainiao.other.demo3;

/**
 * Created by Administrator on 2017/3/14.
 */
public class Main {
    public static void main(String[] args) {
        final MyHander myHander=new MyHander();
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 1; i <= 50; i++) {
                    try {
                        myHander.childThreadDo(i);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println("Child线程退出");
            }
        }).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 1; i <= 50; i++) {
                    try {
                        myHander.mainThreadDo(i);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println("Main线程退出");
            }
        }).start();
    }
}
